! function(m, $) {
	var vm = new Vue({
		el: '#main',
		data: {
			msg: false,
			result: '',
			item: '',
			list:false
		},
		methods: {
			changeShop: function() {},
			location: function() {},
			closeTab:function(){}
		}
	})
	m.plusReady(function() {
		var token = plus.storage.getItem('token');
		$(".mui-input-clear").on('input propertychange', function() {
			vm.changeShop($(this).val());

		})
		$(".mui-input-clear").on('click', function() {
			var tabbar = plus.webview.getWebviewById("tabbar.html");
			tabbar ? tabbar.close() : '';

		})
//		vm.closeTab = function(){
//			var tabbar = plus.webview.getWebviewById("tabbar.html");
//			tabbar ? tabbar.close() : '';
//		}
		vm.changeShop = function(val) {
			mui.ajax(rutour.maps.enter + token, {
				dataType: 'json',
				type: 'get',
				data: {
					name: val
				},
				success: function(data) {
					vm.list = true;
					if(data.code == 200) {
						console.log(data)
						if(data.data.enterList.length && data.data.enterList.length>0) {
							vm.msg = false;
							vm.item = data.data;
						} else {
							vm.msg = true;
							vm.result = '没有检索结果';
						}
					} else {
						vm.msg = true;
					};
				}
			})
		}
		vm.location = function(i) {
			$(".mui-input-clear").val(i.name);
			vm.list = false;
			var maps = plus.webview.getWebviewById("maps.html");
			m.fire(maps, 'serch', {
				i: i
			})
		}
		window.addEventListener('pop', function(event) {
			var val = event.detail.val;
			if(val === '0') {
				vm.msg = true;
				vm.result = '没有检索结果';
			} else {
				vm.msg = false;
				vm.item = val.poiList;
			}
		})
	})

}(mui, jQuery)